﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../assets/css/yui-cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
    <script src="../assets/js/yui-source.js"></script>
	<title>SoundJS v1.0.0 API Documentation : SoundJS</title>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            
                <h1><a href="/soundjs"><img src="../assets/docs-icon-SoundJS.png" title="SoundJS"></a></h1>
            
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Documentation for: 1.0.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
    <h2 class="off-left">APIs</h2>
    <div id="api-tabview" class="tabview">
        <ul class="tabs">
            <li><a href="#api-classes">Classes</a></li>
        </ul>

        <div id="api-tabview-filter">
            <input type="search" id="api-filter" placeholder="Type to filter APIs">
        </div>

        <div id="api-tabview-panel">
            <ul id="api-classes" class="apis classes">
            
                <li><a href="../classes/AbstractPlugin.html">AbstractPlugin</a></li>
            
                <li><a href="../classes/AbstractSoundInstance.html">AbstractSoundInstance</a></li>
            
                <li><a href="../classes/AudioSprite.html">AudioSprite</a></li>
            
                <li><a href="../classes/CordovaAudioLoader.html">CordovaAudioLoader</a></li>
            
                <li><a href="../classes/CordovaAudioPlugin.html">CordovaAudioPlugin</a></li>
            
                <li><a href="../classes/CordovaAudioSoundInstance.html">CordovaAudioSoundInstance</a></li>
            
                <li><a href="../classes/ErrorEvent.html">ErrorEvent</a></li>
            
                <li><a href="../classes/Event.html">Event</a></li>
            
                <li><a href="../classes/EventDispatcher.html">EventDispatcher</a></li>
            
                <li><a href="../classes/FlashAudioLoader.html">FlashAudioLoader</a></li>
            
                <li><a href="../classes/FlashAudioPlugin.html">FlashAudioPlugin</a></li>
            
                <li><a href="../classes/FlashAudioSoundInstance.html">FlashAudioSoundInstance</a></li>
            
                <li><a href="../classes/HTMLAudioPlugin.html">HTMLAudioPlugin</a></li>
            
                <li><a href="../classes/HTMLAudioSoundInstance.html">HTMLAudioSoundInstance</a></li>
            
                <li><a href="../classes/HTMLAudioTagPool.html">HTMLAudioTagPool</a></li>
            
                <li><a href="../classes/PlayPropsConfig.html">PlayPropsConfig</a></li>
            
                <li><a href="../classes/Sound.html">Sound</a></li>
            
                <li><a href="../classes/SoundJS.html">SoundJS</a></li>
            
                <li><a href="../classes/Utility Methods.html">Utility Methods</a></li>
            
                <li><a href="../classes/WebAudioLoader.html">WebAudioLoader</a></li>
            
                <li><a href="../classes/WebAudioPlugin.html">WebAudioPlugin</a></li>
            
                <li><a href="../classes/WebAudioSoundInstance.html">WebAudioSoundInstance</a></li>
            
            </ul>

            <ul id="api-modules" class="apis modules">
            
                <li><a href="CreateJS.html">CreateJS</a></li>
            
                <li><a href="SoundJS.html">SoundJS</a></li>
            
            </ul>
        </div>
    </div>
</div>

            </div>
        </div>
        <div class="yui3-u-3-4">
            <div id="api-options">
        Show:
        <label for="api-show-inherited">
            <input type="checkbox" id="api-show-inherited" checked="">
            Inherited
        </label>

        <label for="api-show-protected">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </div>
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <h1>SoundJS Module</h1>
<div class="box clearfix meta">
    

    

    
        <div class="foundat">
            Defined in: <a href="../files/soundjs_version.js.html#l8"><code>SoundJS:8</code></a>
        </div>
    

    
</div>



<div class="box intro">
    <p>The SoundJS library manages the playback of audio on the web. It works via plugins which abstract the actual audio
implementation, so playback is possible on any platform without specific knowledge of what mechanisms are necessary
to play sounds.</p>
<p>To use SoundJS, use the public API on the <a href="../classes/Sound.html" class="crosslink">Sound</a> class. This API is for:</p>
<ul>
     <li>Installing audio playback Plugins</li>
     <li>Registering (and preloading) sounds</li>
     <li>Creating and playing sounds</li>
     <li>Master volume, mute, and stop controls for all sounds at once</li>
</ul>

<p><b>Controlling Sounds</b><br>
Playing sounds creates <a href="../classes/AbstractSoundInstance.html" class="crosslink">AbstractSoundInstance</a> instances, which can be controlled
individually.</p>
<ul>
     <li>Pause, resume, seek, and stop sounds</li>
     <li>Control a sound&#39;s volume, mute, and pan</li>
     <li>Listen for events on sound instances to get notified when they finish, loop, or fail</li>
</ul>

<h4>Example</h4>

<pre class="code prettyprint"><code> createjs.Sound.alternateExtensions = ["mp3"];
 createjs.Sound.on("fileload", this.loadHandler, this);
 createjs.Sound.registerSound("path/to/mySound.ogg", "sound");
 function loadHandler(event) {
     // This is fired for each sound that is registered.
     var instance = createjs.Sound.play("sound");  // play using id.  Could also use full sourcepath or event.src.
     instance.on("complete", this.handleComplete, this);
     instance.volume = 0.5;
 }</code></pre>
<p><h4>Browser Support</h4>
Audio will work in browsers which support Web Audio (<a href="http://caniuse.com/audio-api" target="_blank"><a href="http://caniuse.com/audio-api">http://caniuse.com/audio-api</a>)
or HTMLAudioElement (<a href="http://caniuse.com/audio" target="_blank"><a href="http://caniuse.com/audio">http://caniuse.com/audio</a>).
A Flash fallback can be used for any browser that supports the Flash player, and the Cordova plugin can be used in
any webview that supports <a href="http://plugins.cordova.io/#/package/org.apache.cordova.media" target="_blank">Cordova.Media</a>.
IE8 and earlier are not supported, even with the Flash fallback. To support earlier browsers, you can use an older
version of SoundJS (version 0.5.2 and earlier).

</div>



<div class="yui3-g">
    <div class="yui3-u-1-2">
        
            <p>This module provides the following classes:</p>

            <ul class="module-classes">
            
                <li class="module-class">
                    <a href="../classes/AbstractPlugin.html">
                        AbstractPlugin
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/AbstractSoundInstance.html">
                        AbstractSoundInstance
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/AudioSprite.html">
                        AudioSprite
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/CordovaAudioLoader.html">
                        CordovaAudioLoader
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/CordovaAudioPlugin.html">
                        CordovaAudioPlugin
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/CordovaAudioSoundInstance.html">
                        CordovaAudioSoundInstance
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/FlashAudioLoader.html">
                        FlashAudioLoader
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/FlashAudioPlugin.html">
                        FlashAudioPlugin
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/FlashAudioSoundInstance.html">
                        FlashAudioSoundInstance
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/HTMLAudioPlugin.html">
                        HTMLAudioPlugin
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/HTMLAudioSoundInstance.html">
                        HTMLAudioSoundInstance
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/HTMLAudioTagPool.html">
                        HTMLAudioTagPool
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/PlayPropsConfig.html">
                        PlayPropsConfig
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/Sound.html">
                        Sound
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/SoundJS.html">
                        SoundJS
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/WebAudioLoader.html">
                        WebAudioLoader
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/WebAudioPlugin.html">
                        WebAudioPlugin
                    </a>
                </li>
            
                <li class="module-class">
                    <a href="../classes/WebAudioSoundInstance.html">
                        WebAudioSoundInstance
                    </a>
                </li>
            
            </ul>
        
    </div>

    <div class="yui3-u-1-2">
        
    </div>
</div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
